﻿using System;

// Token: 0x02000677 RID: 1655
public class KK_Lib
{
	// Token: 0x06002738 RID: 10040 RVA: 0x0014B9C8 File Offset: 0x00149BC8
	public static global::AssetBundleLoadAssetOperation LoadFile<Type>(string _assetBundleName, string _assetName, string _manifest = "")
	{
		if (!global::AssetBundleCheck.IsFile(_assetBundleName, _assetName))
		{
			string message = "読み込みエラー\r\nassetBundleName：" + _assetBundleName + "\tassetName：" + _assetName;
			global::Debug.LogError(message);
			return null;
		}
		global::AssetBundleLoadAssetOperation assetBundleLoadAssetOperation = global::AssetBundleManager.LoadAsset(_assetBundleName, _assetName, typeof(Type), (!_manifest.IsNullOrEmpty()) ? _manifest : null);
		if (assetBundleLoadAssetOperation == null)
		{
			global::Debug.LogError(string.Format("読み込みエラー\r\nassetName：{0}", _assetName));
			return null;
		}
		return assetBundleLoadAssetOperation;
	}

	// Token: 0x06002739 RID: 10041 RVA: 0x0014BA38 File Offset: 0x00149C38
	public static bool Range(int _value, int _min, int _max)
	{
		return _min <= _value && _value <= _max;
	}

	// Token: 0x0600273A RID: 10042 RVA: 0x0014BA50 File Offset: 0x00149C50
	public static bool Range(float _value, float _min, float _max)
	{
		return _min <= _value && _value <= _max;
	}

	// Token: 0x0600273B RID: 10043 RVA: 0x0014BA68 File Offset: 0x00149C68
	public static float GCD(float _a, float _b)
	{
		if (_a == 0f || _b == 0f)
		{
			return 0f;
		}
		while (_a != _b)
		{
			if (_a > _b)
			{
				_a -= _b;
			}
			else
			{
				_b -= _a;
			}
		}
		return _a;
	}

	// Token: 0x0600273C RID: 10044 RVA: 0x0014BAB4 File Offset: 0x00149CB4
	public static float LCM(float _a, float _b)
	{
		return (_a != 0f && _b != 0f) ? (_a / global::KK_Lib.GCD(_a, _b) * _b) : 0f;
	}

	// Token: 0x0600273D RID: 10045 RVA: 0x0014BAE4 File Offset: 0x00149CE4
	public static void Ratio(ref float _outA, ref float _outB, float _a, float _b)
	{
		float num = global::KK_Lib.GCD(_a, _b);
		_outA = _a / num;
		_outB = _b / num;
	}

	// Token: 0x0600273E RID: 10046 RVA: 0x0014BB04 File Offset: 0x00149D04
	public static int Search(int _value)
	{
		if (_value < 2)
		{
			return 0;
		}
		int num = 1;
		for (int i = 2; i < _value; i++)
		{
			int num2 = 0;
			for (int j = 2; j <= i; j++)
			{
				if (i % j <= 0)
				{
					num2++;
				}
			}
			if (num2 == 1)
			{
				num++;
			}
		}
		return num;
	}
}
